﻿using Microsoft.WizardFramework;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HybridLab.Workflow.Activities.UI
{
	internal class HybridLabWizardPage : WizardPage
	{
		// Fields
		private HybridLabWizardForm wizardForm;
		private UserControl userControl;

		// Methods
		public HybridLabWizardPage(HybridLabWizardForm wizardForm, UserControl userControl, Bitmap logo, string title, string linkText)
			: base(wizardForm)
		{
			this.wizardForm = wizardForm;
			base.Headline = title;
			base.StepTitle= linkText;
			base.HelpKeyword = "";
			this.MinimumSize = base.Wizard.WizardFormMinSize;
			base.AutoScaleMode = AutoScaleMode.Font;
			base.Skippable = true;
			this.Dock = DockStyle.None;
			this.AutoScroll = true;
			this.AutoSize = false;
			this.userControl = userControl;
			base.Controls.Add(userControl);
			this.userControl.Dock = DockStyle.None;
			base.PerformLayout();
			if (logo != null)
			{
				base.Logo = logo;
			}
		}

		public override void OnActivated()
		{
			base.OnActivated();
			wizardForm.CheckAndSetButtonState();
		}

		public override bool CanDeactivate
		{
			get
			{
				return wizardForm.CanDeactivatePage(base.Id);
			}
		}
	}
}
